package webInterface;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * this class handles the sharing page of the web interface
 */
public class SharingDir extends HttpServlet
{
	/*
	 * this function handles the sharing page of the web interface
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
	{
		response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        // creating a form asking for a user name with a submit button
        out.println("<html>");
        out.println("<head>");
        out.println("<title>Servlet Sharing Directory</title>");
        out.println("</head>");
        out.println("<body>");
        out.println("<form action=\"webInterface.UserToShare\" method=\"POST\"> \n User Name: <input type=\"text\" name=\"UserName\" size=\"20\"> <br> <input type=\"submit\" value=\"Share User\"> \n </form>\n");
        out.println("</body>");
        out.println("</html>");
        out.close();
	}
}
